import request from '@/utils/requestWorkFlow'

// 获取第一个处理节点选人信息
export function getNodeUserList(params) {
  return request({
    url: '/api/uf/boostor/workflow/processInstance/getNodeUserList/v1',
    method: 'post',
    data: params
  })
}

// 流程发起
export function startWorkFlow(params) {
  return request({
    url: '/api/uf/boostor/workflow/processInstance/startWorkFlow/v1',
    method: 'post',
    data: params
  })
}

// 获取待办
export function taskPending(query) {
  return request({
    url: '/api/uf/boostor/workflow/processInstance/taskPending/v1',
    method: 'post',
    data: query
  })
}

// 根据当前节点获取下一节点和用户
export function nextNodeAndUserList(query) {
  return request({
    url: '/api/uf/boostor/workflow/processInstance/nextNodeAndUserList/v1',
    method: 'post',
    data: query
  })
}

// 流程流转
export function nextNode(query) {
  return request({
    url: '/api/uf/boostor/workflow/processInstance/nextNode/v1',
    method: 'post',
    data: query
  })
}

// 获取所有流程节点
export function getAllNodeInfo(query) {
  return request({
    url: '/api/uf/boostor/workflow/processInstance/getAllNodeInfo/v1',
    method: 'post',
    data: query
  })
}

// 退回任意节点
export function anyNode(query) {
  return request({
    url: '/api/uf/boostor/workflow/processInstance/anyNode/v1',
    method: 'post',
    data: query
  })
}
// 已办
export function haveDone(query) {
  return request({
    url: '/api/uf/boostor/workflow/processInstance/haveDone/v1',
    method: 'post',
    data: query
  })
}

// 获取审批日志
export function historyInfoList(docUnid) {
  return request({
    url: '/api/uf/boostor/workflow/processInstance/getProcessLog/v1',
    method: 'post',
    data: docUnid
  })
}

// 获取审批日志
export function ruleDiagram(params) {
  return request({
    url: '/api/uf/boostor/workflow/processInstance/ruleDiagram/v1',
    method: 'post',
    data: params
  })
}

// 条件查询待办
export function getToDoTaskList(params) {
  return request({
    url: '/api/uf/boostor/workflow/TodoTask/getToDoTaskList/v1',
    method: 'post',
    data: params
  })
}

// 根据业务id查询流程实例
export function getProcessInstanceListByBusinessId(params) {
  return request({
    url: '/api/uf/boostor/workflow/processInstance/getProcessInstanceListByBusinessId/v1',
    method: 'post',
    data: params
  })
}


// export function getTaskWaitByPage(query) {
//   return request({
//     url: '/workflow/task/getTaskWaitByPage',
//     method: 'get',
//     params: query
//   })
// }

// 签收任务
export function claim(taskId) {
  return request({
    url: '/workflow/task/claim/' + taskId,
    method: 'post'
  })
}